package Leetcode;

public class Leetcode_106 {
    public static int hammingWeight(int n) {
        int ret = 0;
        for (int i = 0; i < 32; i++) {
            if ((n & (1 << i)) != 0) {
                ret++;
            }
        }
        return ret;
    }
    public static void main(String[] args) {
        int num = 00000000000000000000000000001011;
        System.out.println(hammingWeight(num));
    }
}
